<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="*|/"><xsl:apply-templates/></xsl:template>

<xsl:template match="text()|@*"><xsl:value-of select="."/></xsl:template>

<xsl:template match='nbsp' name='nbsp'>
<xsl:text disable-output-escaping='yes'>&amp;nbsp;</xsl:text>
</xsl:template>

<xsl:include href='../xsl.include.main.xsl'/>

<xsl:template match="resultsByNick">

<TABLE class="b10b" cellSpacing="0" cellPadding="0"  border="0" width="100%">
	<TBODY>
		<TR> 
			<TD width="8"><IMG height="8" src="/imgs/pvts/box-tl.gif" width="8" border="0"/></TD>
			<TD width="100%" colspan="7" background="/imgs/pvts/box-t-back.gif" bgcolor="white"></TD>
			<TD width="8"><IMG height="8" src="/imgs/pvts/box-tr.gif" width="8" border="0"/></TD>
		</TR>
		<TR vAlign="top"> 
			<TD width="8" background="/imgs/pvts/box-l-back.gif" bgcolor="white"><IMG height="10" src="/imgs/pvts/box-l.gif" width="8" border="0"/></TD>
			<TD width="100%" colspan="7" align="center" style="padding:2px; padding-bottom:12px; " bgcolor="white" class="body">
<xsl:choose>
<xsl:when test='count(result)="1"'>
<xsl:value-of select="count(result)"/> utente trovato
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="count(result)"/> utenti trovati
</xsl:otherwise>
</xsl:choose>
			</TD>
			<TD width="8" background="/imgs/pvts/box-r.gif" bgcolor="white"><IMG height="10" src="/imgs/pvts/box-r.gif" width="8" border="0"/></TD>
		</TR>

<xsl:for-each select="result">
		<xsl:variable name="smile">
			<xsl:choose>
				<xsl:when test="( (floor( @settings div 1024 ) mod 2)  or (floor( @settings div 2048 ) mod 2) ) and @emo = 0">
					/imgs/ecool.gif
				</xsl:when>
				<xsl:when test="( (floor( @settings div 1024 ) mod 2)  or (floor( @settings div 2048 ) mod 2) ) and @emo = 1">
					/imgs/ewink.gif
				</xsl:when>
				<xsl:when test="( (floor( @settings div 1024 ) mod 2)  or (floor( @settings div 2048 ) mod 2) ) and @emo = 2">
					/imgs/elove.gif
				</xsl:when>
				<xsl:when test="( (floor( @settings div 1024 ) mod 2)  or (floor( @settings div 2048 ) mod 2) ) and @emo = 3">
					/imgs/etongue.gif
				</xsl:when>
				<xsl:when test="( (floor( @settings div 1024 ) mod 2)  or (floor( @settings div 2048 ) mod 2) ) and @emo = 4">
					/imgs/ecrazy.gif
				</xsl:when>
				<xsl:when test="( (floor( @settings div 1024 ) mod 2)  or (floor( @settings div 2048 ) mod 2) ) and @emo = 5">
					/imgs/ehappy.gif
				</xsl:when>
				<xsl:when test="( (floor( @settings div 1024 ) mod 2)  or (floor( @settings div 2048 ) mod 2) ) and @emo = 6">
					/imgs/esmile.gif
				</xsl:when>
				<xsl:when test="( (floor( @settings div 1024 ) mod 2)  or (floor( @settings div 2048 ) mod 2) ) and @emo = 7">
					/imgs/eeyes.gif
				</xsl:when>
				<xsl:when test="( (floor( @settings div 1024 ) mod 2)  or (floor( @settings div 2048 ) mod 2) ) and @emo = 8">
					/imgs/econfused.gif
				</xsl:when>
				<xsl:when test="( (floor( @settings div 1024 ) mod 2)  or (floor( @settings div 2048 ) mod 2) ) and @emo = 9">
					/imgs/esad.gif
				</xsl:when>
				<xsl:when test="( (floor( @settings div 1024 ) mod 2)  or (floor( @settings div 2048 ) mod 2) ) and @emo = 10">
					/imgs/eangry.gif
				</xsl:when>
				<xsl:when test="( (floor( @settings div 1024 ) mod 2)  or (floor( @settings div 2048 ) mod 2) )">
					/imgs/eqmark.gif
				</xsl:when>
				<xsl:otherwise>
					/imgs/spacer.gif
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>

		<xsl:variable name="emoDescr">
			<xsl:choose>
				<xsl:when test="( (floor( @settings div 1024 ) mod 2)  or (floor( @settings div 2048 ) mod 2) ) and @emo = 0">
					Oggi mi sento troppo figo/a!
				</xsl:when>
				<xsl:when test="( (floor( @settings div 1024 ) mod 2)  or (floor( @settings div 2048 ) mod 2) ) and @emo = 1">
					Ci siamo capiti...
				</xsl:when>
				<xsl:when test="( (floor( @settings div 1024 ) mod 2)  or (floor( @settings div 2048 ) mod 2) ) and @emo = 2">
					Ho una cotta in corso!
				</xsl:when>
				<xsl:when test="( (floor( @settings div 1024 ) mod 2)  or (floor( @settings div 2048 ) mod 2) ) and @emo = 3">
					Oggi sono arrapato!
				</xsl:when>
				<xsl:when test="( (floor( @settings div 1024 ) mod 2)  or (floor( @settings div 2048 ) mod 2) ) and @emo = 4">
					Oggi non ci sto con la testa!
				</xsl:when>
				<xsl:when test="( (floor( @settings div 1024 ) mod 2)  or (floor( @settings div 2048 ) mod 2) ) and @emo = 5">
					Sto troppo bene!
				</xsl:when>
				<xsl:when test="( (floor( @settings div 1024 ) mod 2)  or (floor( @settings div 2048 ) mod 2) ) and @emo = 6">
					Sto bene!
				</xsl:when>
				<xsl:when test="( (floor( @settings div 1024 ) mod 2)  or (floor( @settings div 2048 ) mod 2) ) and @emo = 7">
					Mhh... Boh... Ci devo pensare...
				</xsl:when>
				<xsl:when test="( (floor( @settings div 1024 ) mod 2)  or (floor( @settings div 2048 ) mod 2) ) and @emo = 8">
					Mi sta prendendo la depressione...
				</xsl:when>
				<xsl:when test="( (floor( @settings div 1024 ) mod 2)  or (floor( @settings div 2048 ) mod 2) ) and @emo = 9">
					Nessuno mi vuole bene!
				</xsl:when>
				<xsl:when test="( (floor( @settings div 1024 ) mod 2)  or (floor( @settings div 2048 ) mod 2) ) and @emo = 10">
					Oggi mi girano!
				</xsl:when>
				<xsl:when test="( (floor( @settings div 1024 ) mod 2)  or (floor( @settings div 2048 ) mod 2) )">
					???
				</xsl:when>
				<xsl:otherwise>

				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<TR vAlign="top"> 
			<TD width="8" background="/imgs/pvts/box-l-back.gif" bgcolor="white"><IMG height="10" src="/imgs/pvts/box-l.gif" width="8" border="0"/></TD>
			<TD width="17px" align="center" style="padding:2px; border-top: 1px solid #999999;" bgcolor="white" class="body">
				<xsl:choose>
				<xsl:when test='@certified = 1'><a class="nick" href="/profileShow.aspx?userGuid={@userid}"><img border="0" style="margin-left:2px;" src="/imgs/cert.gif"/></a></xsl:when>
				<xsl:otherwise>
				&#160;
				</xsl:otherwise>
				</xsl:choose>
			</TD>
			<TD width="28px" align="center" style="padding:2px; border-top: 1px solid #999999;" bgcolor="white" class="body">
				<xsl:choose>
				<xsl:when test='@cg &gt; 0'><a class="nick" href="/userinfo/latest.aspx?userGuid={@userid}"><img border="0" style="margin-left:2px;" src="/imgs/pics.gif"/></a></xsl:when>
				<xsl:when test='string-length(@thumb) &gt; 0'><a href="/profileShow.aspx?userGuid={@userid}"><img border="0" style="margin-left:2px;" src="/imgs/foto.gif"/></a></xsl:when>
				<xsl:otherwise>
				&#160;
				</xsl:otherwise>
				</xsl:choose>
			</TD>
			<TD width="21px" align="center" style="padding:2px; border-top: 1px solid #999999;" bgcolor="white" class="body">
				<xsl:choose>
				<xsl:when test='@cb &gt; 0 and floor( @settings div 8192 ) mod 2'><a class="nick" href="/userinfo/blog.aspx?userid={@userid}"><img border="0" style="margin-left:2px;" src="/imgs/blog.gif"/></a></xsl:when>
				<xsl:otherwise>
				<img border="0" style="width:21px; margin-left:2px;" src="/imgs/spacer.gif"/>
				</xsl:otherwise>
				</xsl:choose>
			</TD>
			<TD width="20px" align="center" style="padding:2px; border-top: 1px solid #999999;" bgcolor="white" class="body">
				<a href="/help/loginemotivo.aspx"><img border="0" alt="{$emoDescr}" src="{$smile}"/></a>
			</TD>
			<TD width="1%" align="center" style="padding:2px; border-top: 1px solid #999999;" bgcolor="white" class="body">
				<xsl:choose>
				<xsl:when test='@sexid="24" or @sexid="26"'><img src="/imgs/male.gif"/></xsl:when>
				<xsl:when test='@sexid="25" or @sexid="27"'><img src="/imgs/female.gif"/></xsl:when>
				</xsl:choose>
			</TD>
			<TD width="50%" align="left" valign="middle" style="padding:2px; border-top: 1px solid #999999;" bgcolor="white" class="body">
				<xsl:choose>
					<xsl:when test='@buddy=@userid'>
						<!-- se e' nella lista amichetti -->
						<a class="nick" href="/profileShow.aspx?userGuid={@userid}">
						<b><xsl:value-of select="@nick"/></b>
						</a>
					</xsl:when>
					<xsl:otherwise>
						<xsl:choose>
						<xsl:when test='@sexid="24" or @sexid="26"'>
							<a class="nick" href="/profileShow.aspx?userGuid={@userid}">
							<xsl:value-of select="@nick"/>
							</a>
						</xsl:when>
						<xsl:when test='@sexid="25" or @sexid="27"'>
							<a class="nick" href="/profileShow.aspx?userGuid={@userid}">
							<xsl:value-of select="@nick"/>
							</a>
						</xsl:when>
						</xsl:choose>
					</xsl:otherwise>
				</xsl:choose>
			</TD>
			<TD width="50%" align="center" valign="middle" style="padding:2px; border-top: 1px solid #999999;" bgcolor="white" class="body">
				<nobr><xsl:value-of select="substring(@lastlogin,9,2)"/>-<xsl:value-of select="substring(@lastlogin,6,2)"/>-<xsl:value-of select="substring(@lastlogin,1,4)"/></nobr>				
			</TD>
			<TD width="8" background="/imgs/pvts/box-r.gif" bgcolor="white"><IMG height="10" src="/imgs/pvts/box-r.gif" width="8" border="0"/></TD>
		</TR>
</xsl:for-each>

		<TR> 
			<TD width="8"><IMG height="8" src="/imgs/pvts/box-bl.gif" width="8" border="0"/></TD>
			<TD width="100%" colspan="7" background="/imgs/pvts/box-b.gif" bgcolor="white"><IMG height="8" src="/imgs/pvts/box-b.gif" width="10" border="0"/></TD>
			<TD width="8"><IMG height="8" src="/imgs/pvts/box-br.gif" width="8" border="0"/></TD>
		</TR>
	</TBODY>
</TABLE>


</xsl:template>

</xsl:stylesheet>